﻿using System;

namespace Anno
{
    [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class RoutePrefixAttribute : Attribute
    {
        public string[] Templates { get; }

        public RoutePrefixAttribute(params string[] templates)
        {
            Templates = templates ?? new string[0];
        }

        public virtual string[] GetTemplates()
        {
            return Templates;
        }
        public virtual string Template
        {
            get
            {
                return Templates != null && Templates.Length > 0 ? Templates[0] : "";
            }
        }
    }
}
